package com.zmn.plat.common.dictionary;

/**
 * 渠道服务工程师黑白名单类型枚举
 *
 * @author linfeng
 * @since 2020/10/23 14:56:30
 */
public enum ChannelEngineerBlackListTypeEnum {

    /**
     * values
     */
    BLACKLISTTYPE(1, "黑名单"),
    WHITELISTTYPE(2, "白名单")
    ;

    private Integer code;
    private String name;

    ChannelEngineerBlackListTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static ChannelEngineerBlackListTypeEnum of(Integer code) {
        if (code == null || code == 0) {
            return WHITELISTTYPE;
        }
        switch (code) {
            case 1:
                return BLACKLISTTYPE;
            case 2:
                return WHITELISTTYPE;
            default:
                return WHITELISTTYPE;
        }
    }
}
